<template>
	<view class="header" :style="'padding-top:'+(height*2+20)+'rpx;'">
		<view class="headerNav" :style="'padding-top:'+(height*2+20)+'rpx;background-color:'+bgColor+';'">
			<view class="navTitle" :style="'margin-right:'+(show?'95rpx':'0')+';color:'+titColor+';'">{{ text }}</view>
		</view>
	</view>
    
</template>

<script>
    import store from '../../../store'
    export default {
		props:['text','showNavBackBtn', 'bgcolor', 'color'],
	  // props: {
		 //  // 导航栏标题
		 //  text: {
			//   type: String,
			//   default: () => {}
		 //  },
		 //  // 是否显示返回按钮
		 //  // showNavBackBtn: {
			//  //  type: String,
			//  //  default: "false"
		 //  // },
		 //  // 背景颜色
		 //  bgcolor: {
			//   type: String,
			//   default: "#F8F8F8"
		 //  },
		 //  // 标题颜色
		 //  color: {
			//   type: String,
			//   default: "#F8F8F8"
		 //  },
		 //  show
	 
      data(){
        return {
            height: "",
            // show: this.showNavBackBtn == 'true',
			bgColor: this.bgcolor,
			titColor: this.color,
			show: true
        }
      },
      mounted() {
        this.height = store.getters.statusBarHeight
		// console.log(this.height)
        if(this.showNavBackBtn !== null){
            this.show = this.showNavBackBtn
        }
      },
      methods: {
        navigateBackPage: function () {
            uni.navigateBack()
        },
      },
    };
</script>

<style scoped>
	.header {
		width: 100%;
		box-sizing: border-box;
		/* padding-bottom: 130rpx; */
	}
    .navBackImg {
        width: 33rpx;
        height: 33rpx;
		line-height:45rpx;
        margin-left: 40rpx;
		margin-bottom: 20rpx;
		margin-top: 9rpx;
		/* margin-right: 20rpx; */
    }

    .headerNav {
		position: fixed;
		top: 0;
		left: 0;
        display: flex;
        align-items: left;
		width: 100%;
		z-index: 999;
    }
	image {
		width: 45rpx;
		height: 45rpx;
	}

    .navTitle {
        /* font-family: 'Arial'; */
        font-style: normal;
        font-weight: 400;
        font-size: 42rpx;
		font-family: fangsong;
		font-weight: bold;
        line-height:45rpx;
        color: #ffffff;
        width: 100%;
        /* display: flex; */
        justify-content: center;
		margin-bottom: 20rpx;
		margin-left: 20rpx;
    }
</style>
